Add a feature to pass user provided files during qcow2ova image conversion - #851
Conversation
|
/cc @kishen-v |
|
/lgtm |
0d7a269 to
d21a092
Compare
|
@kishen-v @anup-kodlekere, PTAL! |
|
LGTM! |
|
/lgtm |
There was a problem hiding this comment.
Code Review
Thanks for the feature! I've left inline comments on the specific issues below. Summary of what needs attention before merge:
- 🔴 [High] Missing flag co-validation —
--write-files-listwithout--write-to-dir-pathsilently dumps files into the image root - 🟡 [Medium]
coreossilently drops user-provided files with no warning - 🟡 [Medium]
MkdirAllruns unconditionally even when no files are specified - 🟠 [Medium] No path traversal guard on
--write-to-dir-path - 🟡 [Low]
os.StatincopyFilesfollows symlinks transparently - 🟢 [Low] Double stat call in
copyFile(minor) - 🟡 [Medium] Broken example command (missing
--image-namevalue) - 🟡 [Medium] No unit tests for the new copy logic
Also worth considering: the flag names --write-files-list and --write-to-dir-path are more verbose than the project style. Something like --inject-files + --inject-dest would be terser and more intent-driven, matching how --prep-template, --cloud-config, --temp-dir are named.
Review done by Bob
d21a092 to
0e6d6c1
Compare
|
Thanks @mkumatag, I've addressed the comments and added relevant UT, PTAL! |
0e6d6c1 to
d209b94
Compare
|
Tested the latest changes Output from the test VM created using this image |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Amulyam24, mkumatag The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
This PR adds a feature to allow user to add custom files to the image built.
--write-files-list is a comma separated list of files and --write-to-dir-path is the path where the files are written in the built image
example:
Tested the following scenarios
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #811
Special notes for your reviewer:
**Output/Demonstration